package jdos.cpu;

import jdos.hardware.Memory;
import jdos.misc.Log;
import jdos.types.LogSeverities;
import jdos.types.LogTypes;

public abstract class Core extends CPU_Regs {
    static public /*PhysPt*/int cseip;
    static public boolean rep_zero;

    static public /*PhysPt*/int base_ds,base_ss;
    static public /*Bitu*/int prefixes;
    static public Table_ea.GetEAHandler[] ea_table;

    static public int Fetchb() {
        return Memory.mem_readb(cseip++);
    }

    static public int Fetchbs() {
        return (byte)Memory.mem_readb(cseip++);
    }

    static public int Fetchw() {
        int temp = Memory.mem_readw(cseip);
        cseip+=2;
        return temp;
    }

    static public int Fetchws() {
        int temp = (short)Memory.mem_readw(cseip);
        cseip+=2;
        return temp;
    }
    static public int Fetchd() {
        int temp = Memory.mem_readd(cseip);
        cseip+=4;
        return temp;
    }
    static public int Fetchds() {
        int temp = Memory.mem_readd(cseip);
        cseip+=4;
        return temp;
    }

    final static public int PREFIX_REP = 0x2;
    final static public int PREFIX_LOCK = 0x4;
    final static public int PREFIX_DW = 0x8;
}
